<?php 
require('class/BCGFont.php');
require('class/BCGColor.php');
require('class/BCGDrawing.php'); 
include(dirname(__FILE__) . "/get_result.php");
include(dirname(__FILE__) ."/class/BCGcode39.barcode.php"); 
 $nam = $sta;
 //$flag=1;
 if ($flag == 0){
// Loading Font
$font = new BCGFont('./class/font/Arial.ttf', 12);

// The arguments are R, G, B for color.
$color_black = new BCGColor(0, 0, 0);
$color_white = new BCGColor(255, 255, 255); 

$code = new BCGcode39();
$code->setScale(2); // Resolution
$code->setThickness(30); // Thickness
$code->setForegroundColor($color_black); // Color of bars
$code->setBackgroundColor($color_white); // Color of spaces
$code->setFont($font); // Font (or 0)
$code->parse($nam); // Text


/* Here is the list of the arguments
1 - Filename (empty : display on screen)
2 - Background color */
$drawing = new BCGDrawing('', $color_white);
$drawing->setBarcode($code);
$drawing->draw();

// Header that says it is an image (remove it if you save the barcode to a file)
header('Content-Type: image/png');

// Draw (or save) the image into PNG format.
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
}
else{  
?>
     <table width="100%" border="0" cellspacing="1" class="form";>
          
		  <tr>
		  	<p  style="text-align:center; font-family: Ubuntu,sans-serif; font-size:42px;">
			<?php echo $sta ?></p>
          </td>
          </tr>
<?php
}
?>

